<?php
/**
 * Create common functions
 */
class Common
{
	private $_siteUrl = 'http://qoop.sutrix.com/backend';

	/**
	 * function setCookieCommon
	 * Set cookie
	 * @param string $name is key of cookie
	 * @param string|array $value is value passed
	 */
	public function setCookieCommon($name, $value) {
		if (is_array($value)) {
			setcookie($name, json_encode($value), time() + 3600, $this->_siteUrl);
		} elseif (is_string($value)) {
			setcookie($name, $value, time() + 3600, $this->_siteUrl);
		}
	}

	/**
	 * function removeCookieCommon
	 * Remove cookie
	 * @param string $name is key of cookie
	 */
	public function removeCookieCommon($name) {
		setcookie($name, '', time() - 3600, $this->_siteUrl);
	}
}